#ifndef IDENTTRACKERTEMPLATE_H
#define IDENTTRACKERTEMPLATE_H

#include "identtracker.h"
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgcodecs.hpp>

class IdentTrackerTemplate : public IdentTracker
{
public:
    IdentTrackerTemplate(float scaleFactor);
    void initialize(const cv::Mat& templateImg, const cv::Rect& roi = cv::Rect()) override;

    // void setFitThreshold_(float fitThreshold_);
    // float getFitThreshold_() const {return fitThreshold;};

    // void setcaleFactor(float scaleFactor_);
    // float getScaleFactor() const {return scaleFactor;};
private:
    float fitThreshold;

    cv::Rect2d detectAndMatch(const cv::Mat& frame,float &Similarity) override;
    cv::Mat templateImg;
    cv::Rect2d bestIdentifiedRect;
    double minDistance;
    cv::Rect2d findClosestIdentifiedRect(const std::vector<cv::Rect2d>& candidates, const cv::Rect2d& prevRect);
};

#endif // IDENTTRACKERTEMPLATE_H
